1 GO TO 9100 10 POKE 65231,7: POKE 65230,INT (RND*3)+1 30 POKE 65234,1: LET dummy=USR 64800 40 RETURN 50 POKE 65234,0: LET dummy=USR 64800 55 RETURN 100 LET redes=0 120 IF dark THEN LET z$="It is pitch dark. You can't see a thing.": GO SUB 10: GO TO 160 130 GO SUB 8000+10*loc 140 LET h$="You can also see:": LET listloc=loc: GO SUB 7000 198 REM Await input (main loop starts here) 200 POKE 23692,100: PRINT : LET m=USR 60000 208 REM Decode command 210 LET m=USR 60400 218 REM Allocate command vars 220 LET tell=PEEK 61124 221 LET pers=PEEK 61125 222 LET vb1=PEEK 61126 223 LET vb2=PEEK 61127 224 LET fk1=PEEK 61129 225 LET ob1=PEEK 61131 226 LET ob2=PEEK 61132 227 LET more=PEEK 61123 230 IF NOT tell AND NOT vb1 THEN GO SUB 300: GO TO 200 240 IF NOT dark OR vb1=3 THEN GO TO 250 242 IF vb1>=3 AND vb1<=10 THEN LET z$="Blundering around in the dark isn't a go od idea!": LET messct=messct+2: GO SUB 10: GO TO 200 244 LET z$="In the dark? You could easily disturb something!": LET messct=messc t+1: GO SUB 10: GO TO 200 248 REM Call verb subroutine 250 GO SUB 900+100*vb1 268 REM Continue analysis of multiple command 270 IF more AND NOT redes THEN LET m=USR 60426: GO TO 210 278 REM Loop for another input 280 IF redes THEN GO TO 100 290 GO TO 200 299 REM General (error) mess's 300 LET z$="I'm sorry, I don't understand that.": GO TO 50 301 LET z$="OK.": GO TO 50 302 LET z$="That isn't here.": GO TO 50 303 LET z$="You aren't carrying that.":: GO TO 50 304 LET z$="You can't. You're wearing it.": GO TO 50 305 LET z$="I'm sorry, but that's just not possible.": GO TO 50 999 REM Verb 1 - talk 1000 LET z$="Who are you talking to, anyway?" 1090 GO TO 50 1099 REM Verb 2 - look 1100 LET redes=1 1110 RETURN 1199 REM Verb 3 - north 1200 IF loc=1 THEN LET z$="You've only just arrived, and besides, the weather ou tside seems to be getting worse.": GO TO 50 1210 IF loc=3 THEN LET dark=0: REM but fall through to general movement routine . 1290 GO TO 1950: REM Skip other movement routines, go to normal movement code. 1299 REM Verb 4 - south 1300 IF loc=1 AND o(1,1)=-1 THEN LET dark=1: REM Set darkness ifentering bar wit h cloak. 1399 REM Verb 5 - east 1499 REM Verb 6 - west 1599 REM Verb 7 - in 1699 REM Verb 8 - out 1799 REM Verb 9 - up 1899 REM Verb 10 - down (and fallthrough for general movementroutine) 1900 REM Space for special "down" lines... 1949 REM ...and the "move normally" routine. 1950 IF NOT l(loc,vb1-2) THEN LET z$="You can't go that way.": GO TO 50 1960 LET loc=l(loc,vb1-2) 1970 LET redes=1 1990 RETURN 1999 REM Verb 11 - get 2000 GO SUB 7100 2002 IF objloc=-1 THEN LET z$="You're already carrying the "+o$(ob1)+".":: GO TO 50 2004 IF objloc<>loc THEN GO TO 302 2006 IF ob1>nobj THEN LET z$="You can't take that.": GO TO 50 2008 IF inv>=maxinv THEN LET z$="You can't carry any more.": GO TO 50 2080 IF o(ob1,2)=2 THEN LET o(ob1,2)=0: REM No longer on hook 2090 LET o(ob1,1)=-1: LET inv=inv+1 2095 GO TO 301 2099 REM Verb 12 - drop 2100 GO SUB 7100 2102 IF objloc<>-1 THEN GO TO 303 2110 IF o(ob1,2)=1 THEN GO TO 304 2120 IF ob1=1 AND loc<>2 THEN LET z$="This isn't the best place to leave a smart cloak lying around.": GO TO 50 2149 REM Also handle "put ob1 on(in) ob2" 2150 IF ob2=0 THEN GO TO 2170 2152 LET obj=ob2: GO SUB 7105 2154 IF objloc=-1 THEN GO TO 305 2156 IF objloc<>loc THEN GO TO 302 2160 IF ob2<>2 THEN LET z$="You can't put anything on that.": GO TO 50 2162 LET o(ob1,2)=2: REM Set objstate to "on hook" 2180 IF ob1=1 AND NOT cloakflag THEN LET cloakflag=1: LET score=score+1 2190 LET o(ob1,1)=loc: LET inv=inv-1 2195 GO TO 301 2199 REM Verb 13 - examine/read 2200 IF NOT ob1 THEN GO TO 2290: REM If noun not recognised, presume scenery word rather thanerror. 2202 GO SUB 7100 2204 IF objloc<>loc AND objloc<>-1 THEN GO TO 302 2210 IF ob1=1 THEN LET z$="A handsome cloak, of velvet trimmed with satin, and s lightly spattered with raindrops. Its blackness is so deep that it almost seems to suck light from the room.": GO TO 10 2230 IF ob1<>2 THEN GO TO 2240 2232 LET z$="It's just a small brass hook, " 2234 IF o(1,2)=2 THEN LET z$=z$+"with a cloak hanging on it.": GO TO 10 2236 LET z$=z$+"screwed to the wall.": GO TO 10 2240 IF ob1=3 THEN GO TO 5000 2290 LET z$="You see nothing special.": GO TO 50 2299 REM Verb 14 - give 2300 LET z$="Nobody here wants anything." 2390 GO TO 50 2399 REM Verb 15 - fight/break 2400 LET z$="Senseles violence will get you nowhere." 2490 GO TO 50 2499 REM Verb 16 - hang 2500 IF NOT ob2 THEN LET ob2=2: REM "hang cloak" -> "hang cloak on hook"- 2510 GO TO 2100: REM -and "hang ob1 on ob2" -> "put ob1 on ob2". 2599 REM Verb 17 - inventory 2600 LET z$="You have with you:": GO SUB 50 2610 LET h$="": LET listloc=-1: GO TO 7000 2699 REM Verb 18 - wear 2700 GO SUB 7100 2702 IF objloc<>-1 THEN GO TO 303 2704 IF o(ob1,2)=1 THEN LET z$="You're already wearing the "+o$(ob1)+"!": GO TO 50 2790 LET o(ob1,2)=1: GO TO 301 2799 REM Verb 19 - remove 2800 IF ob1>nobj OR NOT ob1 THEN GO TO 305 2802 IF o(ob1,2)<>1 THEN LET z$="You're not even wearing the "+o$(ob1)+"!": GO T O 50 2890 LET o(ob1,2)=0: GO TO 301 4998 REM Special functions 4999 REM End game routine 5000 IF messct<2 THEN GO TO 5050 5010 LET z$="The message has been carelessly trampled, making it difficult to re ad. You can just distinguish the words...": GO SUB 10 5020 PRINT : POKE 65230,0: LET z$="You": GO SUB 20: POKE 65232,2: LET z$="Have": GO SUB 20: POKE 65232,4: LET z$="Lost": GO SUB 20 5030 GO TO 5100 5050 LET z$="The message, neatly marked in the sawdust, reads...": GO SUB 10 5060 PRINT : POKE 65230,4: LET z$="You": GO SUB 20: POKE 65232,2: LET z$="Have": GO SUB 20: POKE 65232,4: LET z$="Won": GO SUB 20 5070 LET score=score+1 5100 POKE 65232,0 5150 PRINT : LET z$="You scored "+STR$ score+" out of 2.": GO SUB 50 5170 PRINT : POKE 65232,2: LET z$="Press any key to play again.": GO SUB 50 5180 GO SUB 7900 5190 GO TO 9400 6998 REM General helper funcs 6999 REM Contents lister 7000 LET flag=0 7010 FOR n=1 TO nobj 7020 IF o(n,1)<>listloc THEN GO TO 7070 7030 IF NOT flag AND h$<>"" THEN LET z$=h$: GO SUB 50 7040 LET z$=o$(n) 7045 IF o(n,2) THEN LET z$=z$+" - "+s$(o(n,2)) 7050 GO SUB 50 7060 LET flag=1 7070 NEXT n 7080 IF NOT flag AND h$="" THEN LET z$="nothing.": GO TO 50 7090 RETURN 7099 REM Noun (object OR static)location finder 7100 LET obj=ob1 7104 REM Entry point for less common cases (e.g. ob2) 7105 IF obj<=nobj AND obj<>0 THEN LET objloc=o(ob1,1): RETURN 7109 REM For static objects: 7110 IF obj=2 THEN LET objloc=2: RETURN 7120 IF obj=3 THEN LET objloc=3: RETURN 7190 LET objloc=0: RETURN : REM Non-recognised or virtual objs. 7899 REM Single key input 7900 IF INKEY$<>"" THEN GO TO 7900 7901 LET k$=INKEY$: IF k$="" THEN GO TO 7901 7905 RETURN 7910 REM Could add Y/N-specific routine here for quit/save/&c. 8000 REM Room descriptions 8010 LET z$="You are standing in a spacious hall, splendidly decorated in red an d gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west." 8019 GO TO 10 8020 LET z$="The walls of this small room were clearly once lined with hooks, th ough now only one remains. The exit is a door to the east." 8029 GO TO 10 8030 LET z$="The bar, much rougher than you'd have guessed after the opulence of the foyer to the north, is completely empty. There seems to be some sort of mes sage scrawled in the sawdust on the floor." 8039 GO TO 10 8999 STOP 9000 CLEAR 59999 9010 LOAD "PARSER"CODE 9015 POKE 60033,0: POKE 60034,0: POKE 60035,0 9020 LOAD "illum"CODE : LOAD "chars:c"CODE : LOAD "capitals:c"CODE 9025 POKE 23607,249 9099 REM Opening screen 9100 RANDOMIZE : LET restart=0 9110 PAPER 7: INK 0: BORDER 7: CLS 9120 INK 4: PRINT "[\";: FOR n=2 TO 29 STEP 2: PRINT "~?";: NEXT n: PRINT "|}[]" ; 9130 FOR n=1 TO 20: PRINT TAB 30;"{}[]";: NEXT n: PRINT TAB 30;"{}" 9140 PRINT AT 1,0;: INK 0 9160 POKE 65232,2: POKE 65233,2 9170 LET z$="Hurrying through the rainswept November night, you're glad to see t he bright lights of the Opera House. It's surprising that there aren't more peop le about but, hey, what do you expect in a cheap demo game...?": GO SUB 10 9199 REM Read static data 9200 LET nobj=1: LET nloc=3 9210 DIM o$(nobj,12): DIM s$(2,11) 9220 RESTORE 9300 9230 FOR n=1 TO nobj: READ o$(n): NEXT n 9240 FOR n=1 TO 2: READ s$(n): NEXT n 9300 DATA "velvet cloak" 9340 DATA "worn","on the hook" 9399 REM Read dynamic data 9400 LET loc=1: LET dark=0: LET score=0 9401 LET maxinv=10 9405 LET cloakflag=0: LET messct=0 9410 DIM l(nloc,8): DIM o(nobj,2) 9420 RESTORE 9500 9430 FOR n=1 TO nloc: FOR m=1 TO 8: READ l(n,m): NEXT m: NEXT n 9440 FOR n=1 TO nobj: FOR m=1 TO 2: READ o(n,m): NEXT m: NEXT n 9500 DATA 0,3,0,2,0,0,0,0, 0,0,1,0,0,0,0,0, 1,0,0,0,0,0,0,0 9540 DATA -1,1 9599 REM Calculate dynamic data 9700 LET inv=0: FOR n=1 TO nobj: IF o(n,1)=-1 THEN LET inv=inv+1 9701 NEXT n 9900 IF restart THEN GO TO 9930 9910 PRINT '': POKE 65232,3: LET z$="Press any key to start...": GO SUB 50 9920 GO SUB 7900 9930 LET restart=1 9940 CLS 9950 POKE 65232,0: POKE 65233,0 9990 GO TO 100